n = int (input("请输入一个数，将会寻找1~这个数字间的完数的："))
for x in range (1,n):
    sum = 0
    for y in range(1,int(x/2)+1):
        if x/y == int(x/y):
            sum = sum + y
    if sum == x:
        print(x)